
import Taro from "@tarojs/taro"
export const setSafeArea = (res) => {
    return {
        type: 'SET',
        payLoad: res
    }
}
// 异步的 action
export const actionSafeArea = function () {
    return dispatch => {
        Taro.getSystemInfo({
            success(res) {
                const safeHeight: number = res.screenHeight - res.safeArea.bottom
                console.log("安全高度", safeHeight)
                dispatch(setSafeArea(safeHeight))
            }
        })
    }
}